package com.apes.fn.server.InnerError;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import com.apes.framework.util.ApesConst;
import com.apes.scm.masterdata.product.model.Product;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;
import com.apes.framework.jpa.Model;
import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.*;

/**
 * Creator: zouyc
 * CreateDate: 2019-12-30 15:56
 * Description:
 **/
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = InnerError.CONST_TABLE_NAME)
public class InnerError extends Model {
    public static final String CONST_TABLE_NAME = "error_inner";

    @Id
    @Column(name = "id", nullable = false, length = 24)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "明细行编码编码", padding = 12)
    private String id;

    @Column(name = "product_id", length = 250)
    @Comment("商品")
    private String product;

    @Column(name = "refer_tax_old", nullable = false, columnDefinition = ApesConst.FIELD_MONEY_16_4_0)
    @Comment("参考成本原")
    private double referTaxOld = 0;

    @Column(name = "refer_tax_new", nullable = false, columnDefinition = ApesConst.FIELD_MONEY_16_4_0)
    @Comment("参考成本新")
    private double referTaxNew = 0;

    @Column(name = "model_price", nullable = false, columnDefinition = ApesConst.FIELD_MONEY_16_4_0)
    @Comment("车型加价额")
    private double modelPrice = 0;

    @Column(name = "retail_price", nullable = false, columnDefinition = ApesConst.FIELD_MONEY_16_4_0)
    @Comment("分销协议价")
    private double retailPrice = 0;

    @Column(name = "refer_price", nullable = false, columnDefinition = ApesConst.FIELD_MONEY_16_4_0)
    @Comment("参考成本价")
    private double referPrice = 0;
}
